package cn.lds.j375.healthexam.controller;

import cn.lds.j375.healthexam.dto.ResultDTO;
import cn.lds.j375.healthexam.entity.HealthExamPackage;
import cn.lds.j375.healthexam.exception.SysException;
import cn.lds.j375.healthexam.service.HealthExamPackageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/hep")
public class HealthExamPackageController {

    private static final Logger log = LoggerFactory.getLogger(HealthExamPackageController.class);
    @Autowired
    private HealthExamPackageService healthExamPackageService;

    @GetMapping("/show_package_by")
//    @ResponseBody
    public String showPackageDesc(Integer id, Model model) throws SysException {

        log.info("id:{}",id);
        ResultDTO<HealthExamPackage> healthExamPackageResultDTO =
                healthExamPackageService.selectHealthExamPackageById(id);
        model.addAttribute("result",healthExamPackageResultDTO);

        return "show_hep_desc";
    }
}
